using System;
using System.Collections.Generic;
using System.Text;
using SwinMessengerLibrary;

namespace SwinMessengerConsoleApp
{
    class RosterCommand: SwinMessengerCommand
    {
        /// <summary>
        /// This is the roster command it will print out a list of your contacts
        /// </summary>
        public RosterCommand()
            : base(new string[] { "roster"})
        {
        }
        /// <summary>
        /// This command prints out the roster of the account loged into the server
        /// </summary>
        /// <param name="runOn">The server that the account is loged into</param>
        /// <param name="parameters">ther parameters of the roster</param>
        /// <returns>the roster to be printed to the screen</returns>
        public override List<string> Execute(Server runOn, string[] parameters)
        {
            List<string> tempList = new List<string>();
            int count = 0;
            foreach (Contact contact in runOn.Roster.Contacts)
            {
                tempList.Add(count + " - " + contact.Id + " (" + contact.Status.ToString() + ")");
                    count ++;
            }
            return tempList;
        }
    }
}
